define([
  'jquery',
  'views/View',
  'hbs!template/alert-message'
], function($, View, template){
  var AlertMessageView = View.extend({
    //tagName: "li",

    events: {
      "click a[name=close]":    "close"
    },
    
    initialize: function() {
      this.template = template;
    },
    
    render: function() {
      $(this.el).html(this.template(this.model.toJSON()));
      //$("#box").append(this.el);
      return this;
    },
    
    close: function() {
      $(this.el).remove();
    }
  });

  return AlertMessageView;
});